package org.wu.reggie.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.wu.reggie.entity.User;

public interface UserMapper {

    @Select("select * from user where phone = #{phone} ")
    User findByPhone(String phone);

    @Insert("insert into user(phone,status) values (#{phone},#{status})")
    @Options(keyColumn = "id",keyProperty = "id",useGeneratedKeys = true)
    void save(User dbUser);

    @Select("select * from user where id = #{userId}")
    User findById(Long userId);
}
